// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
jQuery(function($) {
  $("#request_car_brand_id").change(function() {
    var car_brand = $('select#request_car_brand_id :selected').val();
    if(car_brand == "") car_brand="0";
    jQuery.get('/welcome/update_car_brand_select/' + car_brand, function(data){
        $("#carModels").html(data);
    })
    return false;
  });

})

jQuery(function($) {
  $("#car_car_brand_id").change(function() {
    var car_brand = $('select#car_car_brand_id :selected').val();
    if(car_brand == "") car_brand="0";
    jQuery.get('/cars/update_car_brand_select/' + car_brand, function(data){
        $("#carModels").html(data);
    })
    return false;
  });

})

jQuery(function($) {
  $("#filter_car_brand_id").live("change", function() {
    var car_brand = $('select#filter_car_brand_id :selected').val();
    if(car_brand == "") car_brand="0";
    jQuery.get('/suppliers/update_car_brand_select/' + car_brand, function(data){
        $("#carModels").html(data);
    })
    return false;
  });

})